﻿using System;
using System.Diagnostics;
using CtefCrmImport.Common.Interfaces;

namespace CtefCrmImport
{
    public class Logger : ILogger
    {
        private readonly TextWriterTraceListener textTraceListener;

        public Logger(string fileName)
        {
            textTraceListener = new TextWriterTraceListener(fileName, "myListener");
        }

        public void Log(string format, params object[] args)
        {
            var output = args != null && 0 < args.Length ? string.Format(format, args) : format;

            Console.WriteLine(output);
            textTraceListener.WriteLine(output);
        }

        public void Flush()
        {
            textTraceListener.Flush();
        }

        public string GetFullLog()
        {
            return "";
        }

        public void Reset()
        {
        }
    }
}
